x = eval(input("请输入税前收入："))
r = x - 5000
t = 0
if r > 0:
   m = min(r,1500)
   t = t + m * 0.03
   r = r - m
if r > 0:
   m = min(r,4500-1500)
   t = t + m * 0.2
   r = r - m
if r > 0:
   m = min(r,9000-4500)
   t = t + m * 0.2
   r = r - m
if r > 0:
   m = min(r,35000-9000)
   t = t + m * 0.25
   r = r - m
if r > 0:
   m = min(r,55000-35000)
   t = t + m * 0.3
   r = r - m
if r > 0:
   m = min(r,80000-55000)
   t = t + m * 0.35
   r = r - m
if r > 0:
   m = r
   t = t + m * 0.45

print(t)